package test.serize;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Hashtable;

/**
 * 会话
 * 
 * @author Administrator
 * 
 */
public class SessionHn implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2493842618377052072L;
	
	//用户KEY
	final public static String KEY_USERBEAN="sk_userbean";
	
	//用户操作ID的KEY
	final public static String KEY_OPERATEID="operate_id";
	

	private String id;
	private Hashtable<String, Object> elements;
	
	public HashMap<String, Object> map;

	public SessionHn() {
		elements = new Hashtable<String, Object>();
		map=new HashMap<String, Object>();
	}

	/**
	 * 得到所有元素
	 * 
	 * @return
	 */
	public Hashtable<String, Object> getElements() {
		return elements;
	}

	/**
	 * 得到一个元素
	 * 
	 * @param key
	 * @return
	 */
	public Object getElement(String key) {
		return elements.get(key);
	}

	/**
	 * 删除一个元素
	 * 
	 * @param key
	 */
	public void deleteElement(String key) {
		elements.remove(key);
	}

	/**
	 * 全部清除
	 */
	public void cleanAllelement() {
		elements.clear();
	}

	/**
	 * 放入一个元素
	 * @param key
	 * @param value
	 */
	public void addElement(String key, Object value) {
		elements.put(key, value);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

}
